package com.cs.user.controller;

import com.cs.common.result.HttpResp;
import com.cs.common.result.ResultCode;
import com.cs.domain.entity.Role;
import com.cs.domain.entity.UserInfo;
import com.cs.user.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/api/role")
public class RoleController {

    @Autowired
    private IRoleService roleService;

    @GetMapping("/findAllRole")
    public HttpResp findAllRole(){
        List<Role> allRole = roleService.findAllRole();
        return HttpResp.result(ResultCode.USER_QUERY_SUCCESS,new Date(),allRole);
    }
}
